from rest_framework.viewsets import ModelViewSet
from django.contrib.auth.models import Group,Permission
from meiduo_admin.my_paginate import MyPageNumberPagination
from meiduo_admin.serializers import permission_group_serializers
from rest_framework.generics import ListAPIView

#1,获取用户权限组信息
class PermissionGroupView(ModelViewSet):
    pagination_class = MyPageNumberPagination
    serializer_class = permission_group_serializers.PermissionGroupSerializer
    queryset = Group.objects.order_by("id")

#2,获取所有权限
class PermissionGroupSimpleView(ListAPIView):
    serializer_class = permission_group_serializers.PermissionGroupSimpleView
    queryset = Permission.objects.all()